import { createWebHistory, createRouter } from 'vue-router'

import HomeView from '../views/home/index.vue'
import Detail from '../views/detail.vue'
import Login from '../views/login.vue'
//二级路由
import Sy from '../views/home/sy.vue'
import Classify from '../views/home/classify.vue'
const routes = [
    //重定向
    { path: '/', redirect: '/home' },
    { path: '/login', component: Login },
    { path: '/detail', component: Detail },
    {
        path: '/home',
        component: HomeView,
        children: [
            //重定向
            { path: '/home', redirect: '/home/sy' },
            { path: 'sy', component: Sy },
            { path: 'classify', component: Classify },
        ]
    },
]

const router = createRouter({
    history: createWebHistory(),
    routes,
})
export default router